<template>
	<!-- 公共左 -->
	<div style="width:300px;position: relative;margin-left: 220px;">
		<div style="width:273px;overflow: hidden;background-color: #f4f5f6;position: absolute;right: 10px;">
			<div style="height: 85vh;width:250px; margin-left: 40px;margin-right: 20px;overflow-y: scroll;">
				<div v-if="type == 1" width="230px" style="background-color: #FFFFFF;color: #000000; margin-top: 40px;height: 100%;">
					<el-menu :default-openeds="['0']" class="el-menu-vertical-demo">
						<div class="newHome">
							<img style="margin-right: 5px;" class="icon-list" src="../../../static/images/shouye.png" />
							<router-link to="/shop/new_index"><span class="add font-20">后台首页</span></router-link>
						</div>
						<!-- <el-submenu index="0"
			 		            class="add">
			 		  <template slot="title"><img class="icon-list" src="../../../static/images/shouye.png" /> <span class="add font-20"> <router-link to="/shop/new_index">后台首页</router-link></span></template>
			 		  <el-menu-item-group>
			 		    <div class="juzhong">
			 		      <router-link to="/shop/new_index">后台首页</router-link>
			 			   <router-link to="/mall/test">测试页</router-link>
			 		    </div>

			 		  </el-menu-item-group> -->
						</el-submenu>
						<el-submenu index="1" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/shangping.png" /><span class="add font-20">商品管理</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/mall/new_addgood/0">发布商品</router-link>
									<router-link to="/mall/goods_list">商品列表</router-link>
									<!-- <div @click="jump('/mall/goods_list')">商品列表</div> -->
								</div>
								<!-- 	 			<div class="juzhong">
			 				 <router-link to="/mall/goods_list">商品列表</router-link>
			 			</div> -->
								<div class="juzhong">
									<!-- <router-link to="">出售中商品</router-link> -->
									<!-- <router-link to="/mall/introduce_list">推荐商品</router-link> -->
								</div>

							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="2" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/jiaoyi.png" /><span class="add font-20">交易管理</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/mall/order_list">全部订单</router-link>
									<router-link to="/mall/return_list">售后订单</router-link>

								</div>
								<!--   <div class="juzhong">
					     <router-link to="/mall/return_list">售后订单</router-link>
					   			 
					   </div> -->
							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="3" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/yingxiao.png" /> <span class="add font-20">营销工具</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/voucher/voucher_order_list">优惠券订单</router-link>
									<router-link to="/voucher/combos_list">优惠券管理</router-link>
								</div>
								<div class="juzhong">
									<router-link to="/serve/combos_detail/0">优惠券创建</router-link>
									<router-link to="/voucher/cardManage_list">会员卡管理</router-link>
								</div>
								<!-- 
			           <div class="juzhong">
			             <router-link to="/voucher/combos_list">优惠券管理</router-link>
			           </div>
			           <div class="juzhong">
			             <router-link to="/serve/combos_detail/0">优惠券创建</router-link>
			           </div> -->
							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="4" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/dangmian.png" /><span class="add font-20">线上付</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/face/faceto">订单列表</router-link>

								</div>
							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="7" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/qita.png" /><span class="add font-20">账户管理</span></template>
							<el-menu-item-group>

								<div style="border-bottom: 1px solid #DCDCDC;">
									<div class="juzhong">
										<router-link to="/mall/sort_list">商品分类</router-link>
										<router-link to="/mall/size_list/:id">规格列表</router-link>

									</div>
									<div class="juzhong">
										<router-link to="/voucher/voucher_list">服务商品</router-link>
										<router-link to="/shop/BasicInfo">门店信息</router-link>
									</div>
									<div class="juzhong" v-if="appDate == '1'">
										<router-link to="/shop/store_balance">账户余额</router-link>
										<router-link to="/shop/cash_history_list">提现记录</router-link>
									</div>
								</div>


								<!-- 	<div class="juzhong">
							<router-link to="/mall/size_list/:id">规格列表</router-link>
						</div> -->
								<!-- <router-link to="/mall/return_list">售后订单</router-link> -->
								<!-- 	<div class="juzhong">
			 			 
			 			  <router-link to="/voucher/voucher_list">服务商品</router-link>
			 			</div>	 -->
								<!-- 	 			<div class="juzhong">
			 			  <router-link to="/shop/BasicInfo">门店信息</router-link>
			 			</div> -->
							</el-menu-item-group>
						</el-submenu>
					</el-menu>
				</div>
				<div v-if="type == 2" width="230px" style="background-color: #FFFFFF;color: #000000; margin-top: 40px;height: 100%;">
					<el-menu :default-openeds="['0']" class="el-menu-vertical-demo">
						<div class="newHome">
							<img style="margin-right: 5px;" class="icon-list" src="../../../static/images/shouye.png" />
							<router-link to="/shop/new_index"><span class="add font-20">后台首页</span></router-link>
						</div>
						</el-submenu>
						<el-submenu index="1" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/shangping.png" /><span class="add font-20">商品管理</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/mall/new_take_out_good/0">发布商品</router-link>
									<router-link to="/mall/take_goods_list">商品列表</router-link>
								</div>

								<div class="juzhong">
								<router-link to="/mall/take_out_sort_list">商品分类</router-link>
								</div>

							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="2" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/jiaoyi.png" /><span class="add font-20">交易管理</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/mall/order_list">全部订单</router-link>
									<router-link to="/mall/return_list">售后订单</router-link>

								</div>
								<!--   <div class="juzhong">
					     <router-link to="/mall/return_list">售后订单</router-link>
					   			 
					   </div> -->
							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="3" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/yingxiao.png" /> <span class="add font-20">营销工具</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/voucher/voucher_order_list">优惠券订单</router-link>
									<router-link to="/voucher/combos_list">优惠券管理</router-link>
								</div>
								<div class="juzhong">
									<router-link to="/serve/combos_detail/0">优惠券创建</router-link>
									<router-link to="/voucher/cardManage_list">会员卡管理</router-link>
								</div>
								<!-- 
			           <div class="juzhong">
			             <router-link to="/voucher/combos_list">优惠券管理</router-link>
			           </div>
			           <div class="juzhong">
			             <router-link to="/serve/combos_detail/0">优惠券创建</router-link>
			           </div> -->
							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="4" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/dangmian.png" /><span class="add font-20">线上付</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/face/faceto">订单列表</router-link>

								</div>
							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="7" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/qita.png" /><span class="add font-20">账户管理</span></template>
							<el-menu-item-group>

								<div style="border-bottom: 1px solid #DCDCDC;">
									<div class="juzhong">
										<router-link to="/mall/size_list/:id">规格列表</router-link>
										<router-link to="/voucher/voucher_list">服务商品</router-link>
									</div>
									
									<div class="juzhong">
										
										<router-link to="/shop/BasicInfo">门店信息</router-link>
										<router-link v-if="appDate == '1'" to="/shop/store_balance">账户余额</router-link>

									</div>
									<div class="juzhong" v-if="appDate == '1'">
										<router-link to="/shop/cash_history_list">提现记录</router-link>
									</div>
								</div>

							</el-menu-item-group>
						</el-submenu>
					</el-menu>
				</div>

				<div v-if="type == 4 || type == 5 || type == 6 || type == 7 || type == 8" width="230px" style="background-color: #FFFFFF;color: #000000; margin-top: 40px;height: 100%;">
					<el-menu :default-openeds="['0']" class="el-menu-vertical-demo">
						<div class="newHome">
							<img style="margin-right: 5px;" class="icon-list" src="../../../static/images/shouye.png" />
							<router-link to="/shop/new_index"><span class="add font-20">后台首页</span></router-link>
						</div>
						<!-- <el-submenu index="0"
			 			 		            class="add">
			 			 		  <template slot="title"><img class="icon-list" src="../../../static/images/shouye.png" /> <span class="add font-20">后台首页</span></template>
			 			 		  <el-menu-item-group>
			 			 		    <div class="juzhong">
			 			 		      <router-link to="/shop/new_index">后台首页</router-link>
			 			 			   <router-link to="/mall/test">测试页</router-link>
			 			 		    </div>
			 			  
			 			 		 
			 			 		  </el-menu-item-group>
			 			 		</el-submenu> -->
						<el-submenu index="1" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/shangping.png" /><span class="add font-20">套餐管理</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/serve/combos_list">套餐列表</router-link>
									<router-link to="/serve/combos_order_list">套餐订单</router-link>
									<!-- <div @click="jump('/mall/goods_list')">商品列表</div> -->
								</div>
								<!-- 	<div class="juzhong">
			 			 				 <router-link to="/serve/combos_order_list">套餐订单</router-link>
			 			 			</div> -->

							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="2" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/jiaoyi.png" /><span class="add font-20">交易管理</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/mall/order_list">全部订单</router-link>
									<router-link to="/mall/return_list">售后订单</router-link>

								</div>
								<!--   <div class="juzhong">
					     <router-link to="/mall/return_list">售后订单</router-link>
					   			 
					   </div> -->
							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="3" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/yingxiao.png" /> <span class="add font-20">营销工具</span></template>
							<el-menu-item-group>
								<div class="juzhong" style="flex-wrap: wrap;">
									<router-link to="/voucher/voucher_order_list">优惠券订单</router-link>
									<router-link to="/voucher/combos_list">优惠券管理</router-link>
								</div>
								<div class="juzhong" style="flex-wrap: wrap;">
									<router-link to="/serve/combos_detail/0">优惠券创建</router-link>
									<router-link to="/voucher/cardManage_list">会员卡管理</router-link>
								</div>

								<!--  <div class="juzhong">
			           <router-link to="/voucher/combos_list">优惠券管理</router-link>
			         </div>
			         <div class="juzhong">
			           <router-link to="/serve/combos_detail/0">优惠券创建</router-link>
			         </div> -->
							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="4" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/dangmian.png" /><span class="add font-20">线上付</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/face/faceto">订单列表</router-link>

								</div>
							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="7" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/qita.png" /><span class="add font-20">账户管理</span></template>
							<el-menu-item-group>
								<div style="border-bottom: 1px solid #DCDCDC;">
									<div class="juzhong">
										<router-link to="/mall/sort_list">商品分类</router-link>
										<router-link to="/mall/size_list/:id">规格列表</router-link>

									</div>
									<div class="juzhong">
										<router-link to="/voucher/voucher_list">服务商品</router-link>
										<router-link to="/shop/BasicInfo">门店信息</router-link>
									</div>
									<div class="juzhong" v-if="appDate == '1'">
										
										<router-link to="/shop/store_balance">账户余额</router-link>
										<router-link to="/shop/cash_history_list">提现记录</router-link>
									</div>
								</div>

								<!-- 	<div class="juzhong">
			 							<router-link to="/mall/size_list/:id">规格列表</router-link>
										
			 						</div> -->
								<!-- <router-link to="/mall/return_list">售后订单</router-link> -->
								<!-- 	<div class="juzhong">
			 			 			
			 			 			  <router-link to="/voucher/voucher_list">服务商品</router-link>
			 			 			</div>		 -->
								<!-- 	<div class="juzhong">
			 			 			  <router-link to="/shop/BasicInfo">门店信息</router-link>
			 			 			</div> -->
							</el-menu-item-group>
						</el-submenu>
					</el-menu>
				</div>



				<div v-if="type == 3" width="230px" style="background-color: #FFFFFF;color: #000000; margin-top: 40px;height: 100%;">
					<el-menu :default-openeds="['0']" class="el-menu-vertical-demo">
						<div class="newHome">
							<img style="margin-right: 5px;" class="icon-list" src="../../../static/images/shouye.png" />
							<router-link to="/shop/new_index"><span class="add font-20">后台首页</span></router-link>
						</div>
						<!-- 	<el-submenu index="0"
			 		            class="add">
			 		  <template slot="title"><img class="icon-list" src="../../../static/images/shouye.png" /> <span class="add font-20">后台首页</span></template>
			 		  <el-menu-item-group>
			 		    <div class="juzhong">
			 		      <router-link to="/shop/new_index">后台首页</router-link>
			 			   <router-link to="/mall/test">测试页</router-link>
			 		    </div>
			  
			 		 
			 		  </el-menu-item-group>
			 		</el-submenu> -->
						<el-submenu index="1" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/shangping.png" /><span class="add font-20">房间管理</span></template>
							<!--         <el-menu-item-group>
			           <div class="juzhong" v-for="(items, index) in nav[0].children" :key="index">
			             <router-link v-if="items.hidden !== true" :to="items.path">{{items.name}}</router-link>
			 							<div @click="jump('/mall/goods_list')">商品列表</div> -->
							<!-- </div> -->
							<!-- <div class="juzhong">
			 				 <router-link to="/serve/combos_order_list">套餐订单</router-link>
			 			</div> -->
							<!-- <div class="juzhong">
			            <router-link to="/serve/combos_list">优惠套餐列表</router-link>
			           </div> -->

							<!--    </el-menu-item-group> -->
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/serve/hotel_list">客房列表</router-link>
									<router-link to="/serve/hotel_order_list">客房订单</router-link>
									<!-- <div @click="jump('/mall/goods_list')">商品列表</div> -->
								</div>
								<!-- <div class="juzhong">
					 			 				 <router-link to="/serve/hotel_order_list">客房订单</router-link>
					 			 			</div> -->
							</el-menu-item-group>
						</el-submenu>
						<!-- 	       <el-submenu index="2"
			                   class="add">
			         <template slot="title"><img class="icon-list" src="../../../static/images/jiaoyi.png" /><span class="add font-20">交易管理</span></template>
			         <el-menu-item-group>
			           <div class="juzhong">
			             <router-link to="/mall/order_list">全部订单</router-link>
			 		 
			             <router-link to="/mall/return_list">售后订单</router-link>
			 
			           </div>
			         </el-menu-item-group>
			       </el-submenu> -->
						<el-submenu index="3" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/yingxiao.png" /> <span class="add font-20">营销工具</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/voucher/voucher_order_list">优惠券订单</router-link>
									<router-link to="/voucher/combos_list">优惠券管理</router-link>

								</div>
								<div class="juzhong">
									<router-link to="/serve/combos_detail/0">优惠券创建</router-link>
									<router-link to="/voucher/cardManage_list">会员卡管理</router-link>
								</div>
								<!--          <div class="juzhong">
			            <router-link to="/voucher/combos_list">优惠券管理</router-link>
			          </div>
			          <div class="juzhong">
			            <router-link to="/serve/combos_detail/0">优惠券创建</router-link>
			          </div> -->
							</el-menu-item-group>
						</el-submenu>
						<el-submenu index="4" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/dangmian.png" /><span class="add font-20">线上付</span></template>
							<el-menu-item-group>
								<div class="juzhong">
									<router-link to="/face/faceto">订单列表</router-link>

								</div>
							</el-menu-item-group>
						</el-submenu>
						</el-submenu>
						<el-submenu index="7" class="add">
							<template slot="title"><img class="icon-list" src="../../../static/images/qita.png" /><span class="add font-20">账户管理</span></template>
							<el-menu-item-group>
								<div style="border-bottom: 1px solid #DCDCDC;">
									<div class="juzhong">
										<router-link to="/mall/sort_list">商品分类</router-link>
										<router-link to="/mall/size_list/:id">规格列表</router-link>
									</div>
									<div class="juzhong">
										<router-link to="/voucher/voucher_list">服务商品</router-link>
										<router-link to="/shop/BasicInfo">门店信息</router-link>
									</div>
									<div class="juzhong" v-if="appDate == '1'">
										<router-link to="/shop/store_balance">账户余额</router-link>
										<router-link to="/shop/cash_history_list">提现记录</router-link>
									</div>
								</div>

								<!-- <div class="juzhong">
			 		 			 			  <router-link to="/mall/return_list">售后订单</router-link>
			 		 			 			   <router-link to="/mall/size_list/:id">规格列表</router-link>
			 		 			 			</div>	 -->
								<!-- 	<div class="juzhong">
			 		 			 			  <router-link to="/mall/return_list">售后订单</router-link>
			 		 			 			  <router-link to="/voucher/voucher_list">服务商品</router-link>
			 		 			 			</div>	 -->
								<!-- <div class="juzhong">
			 		 			 			  <router-link to="/shop/BasicInfo">门店信息</router-link>
			 		 			 			</div> -->
							</el-menu-item-group>
						</el-submenu>
					</el-menu>
				</div>
			</div>
		</div>
	</div>
</template>
<style>
	#app {
		font-size: 18px;
	}

	.icon-list {
		width: 20px;
		height: 20px;
		margin-right: 5px;
	}

	.juzhong {
		display: flex;
		justify-content: space-between;
		align-content: center;
		padding: 0 20px;
		background-color: #FFFFFF;
	}

	.juzhong a {
		padding: 5px 5px 5px 0;
		padding-bottom: 10px;
		font-size: 16px;
		color: #8a8a8a;

	}

	.juzhong :hover {
		color: #409eff;
	}

	.add {
		color: #000000;
	}

	.font-20 {
		font-size: 18px;
		margin-left: 10px;
	}

	.juzhong span {
		padding: 15px;
		padding: 5px;
		padding-bottom: 20px;
	}

	.el-header {
		background-color: #b3c0d1;
		color: #333;
		line-height: 60px;
	}

	.el-aside {
		color: #333;
	}

	.el-menu-vertical-demo {
		background-color: #FFFFFF !important;
	}

	.el-menu-item-group__title {
		padding-top: 0 !important;
	}

	.el-card {
		border: none !important;
		box-shadow: none !important;
	}

	.el-card__header {
		border-bottom: 1px solid #DCDCDC !important;
	}

	.el-submenu__title {

		border-top: 1px solid #DCDCDC !important;
	}

	.newHome {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		padding: 20px;
	}
	.newHome a{
		color: #222222;
		font-size: 18px;
	}
	.newHome a:hover{
		color: #409eff;
		font-size: 18px;
	}
</style>
<script>
	export default {
		data() {
			return {
				nav: [],
				show: true,
				noHandleJiuDian: 0,
				noHandle: 0,
				noReturn: 0,
				type: '',
				appDate: '',
			}
		},
		created() {
			this.type = JSON.parse(sessionStorage.getItem('permission')).storeType
			this.appDate = JSON.parse(sessionStorage.getItem('permission')).appData
			this.fetchNav(this.$route)
			// this.fetchData()
			// setInterval(this.fetchData,1000*300)
			// alert(this.type)
			// this.fetchNav(this.$route)

			// this.fetchData()
			// setInterval(this.fetchData, 1000 * 300)

		},
		watch: {

		},

		methods: {
			jump(e) {
				this.$router.push(e)
			},
			fetchNav(to) {

				let routes = this.$router.options.routes;
				let arr = []
				if (this.type == '1') {
					for (let key in routes) {
						if (routes[key].name == '普通商城') {
							this.nav.push(routes[key])
						}
					}
					// for (let key in routes) {
					//   if (routes[key].name == '普通商城' || routes[key].name == '门店信息' || routes[key].name == '代金券' || routes[key].name == '线上付') {
					//     this.nav.push(routes[key])
					//   }
					// }
				}
				if (this.type == 3) {
					for (let key in routes) {
						if (routes[key].name == '服务商城') {
							this.nav.push(routes[key])
						}
					}
					for (var i = this.nav.length - 1; i >= 0; i--) {
						if (this.nav[i].name == '优惠套餐列表') {
							this.nav.splice(i, 1)
						}
						if (this.nav[i].name == '套餐订单') {
							this.nav.splice(i, 1)
						}

					}
				}
				//console.log(routes)
			},


		}
	}
</script>

<style scoped>
	@font-face {
		font-family: "iconfont";
		/* project id 276398 */
		src: url("//at.alicdn.com/t/font_wsw4c3bnxbf0f6r.eot");
		src: url("//at.alicdn.com/t/font_wsw4c3bnxbf0f6r.eot?#iefix") format("embedded-opentype"),
			url("//at.alicdn.com/t/font_wsw4c3bnxbf0f6r.woff") format("woff"),
			url("//at.alicdn.com/t/font_wsw4c3bnxbf0f6r.ttf") format("truetype"),
			url("//at.alicdn.com/t/font_wsw4c3bnxbf0f6r.svg#iconfont") format("svg");
	}

	.iconfont {
		margin-right: 15px;
	}
</style>
